using System;
using Book_Shop.DAL.DAO;

namespace Book_Shop.BLL
{
    public class OrderManager
    {
        public string InitOrder(ref OrderSheet orderSheet)
        {
            Reader reader = new Reader(){
                                                   Id = 1,
                                                   FirstName = "Arefin",
                                                   LastName = "Irfan",
                                                   Address="Dhaka",
                                                   Email = "arefin@gmail.com",
                                                   UserName = "arefin",
                                                   Password = "arefin"
                                               };
            Shop shop = new Shop()
                            {
                                Id = 1,
                                Location = "Dhaka",
                                Title = "New Book House"
                            };

            orderSheet =  new OrderSheet()
                              {
                                  DateOfOrder = DateTime.Now.Date,
                                  OrderLocation = "M33, Dhaka",
                              };
            orderSheet.Add(reader);
            orderSheet.Add(shop);
            
            return "Order Sheet Created";
            
        }

        public string AddBookToOrderSheet(OrderSheet orderSheet,Book book)
        {
            if (orderSheet == null)
            {
                throw new Exception("Can't be Added! No OrderSheet Created Yet!");
            }
            else
            {

                orderSheet.Add(book);
                return "Added Book to Order Sheet";
            }
        }
    }
}